package com.timmy.google_play.base;

import android.widget.BaseAdapter;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Timmy on 2016/12/8.
 */

public abstract class MyBaseAdapter<T> extends BaseAdapter {

    public List<T> mDatas = new ArrayList();

    public MyBaseAdapter(List datas)  {
        mDatas = datas;
    }

    @Override
    public int getCount() {
        if (mDatas != null) {
            return mDatas.size();
        }
        return 0;
    }

    @Override
    public T getItem(int position) {

        if (mDatas != null) {
            return mDatas.get(position);
        }

        return null;
    }

    @Override
    public long getItemId(int position) {
        return position;
    }


}